<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib  prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"  %> 
<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html lang="zh-CN">
  <head>
    <base href="<%=basePath%>">
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <title>零件清单</title>
	
	<!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
  </head>
  
  <body class="client-body pl-body">
  
 
  		<jsp:include page="../common/client-head.jsp"></jsp:include>
  		<script type="text/javascript" src="resources/js/system/carDesign/partList.js"></script>
  		
  		<div id="client-content" class="client-content">
  			<div class="pl-GPS">
	  			<a id="pl-GPS1" class="a-black GPSactive" href="front/carDesign/partList?<%=  request.getQueryString() %>#list1">内外饰</a>
	  			<a id="pl-GPS2" class="a-black" href="front/carDesign/partList?<%=  request.getQueryString() %>#list2">底盘</a>
	  			<a id="pl-GPS3" class="a-black" href="front/carDesign/partList?<%=  request.getQueryString() %>#list3">电器</a>
	  			<a id="pl-GPS4" class="a-black" href="front/carDesign/partList?<%=  request.getQueryString() %>#list4">车身</a>
	  			<a id="pl-GPS5" class="a-black" href="front/carDesign/partList?<%=  request.getQueryString() %>#list5">车身附件</a>
	  		</div>
	  		
	  		<div class="pl-clientContent">
		  		<div class="co-head">
	  				<div class="co-headTop">
	  					<div class="co-headCol co-headTitle">零件清单</div>
	  					<div class="co-headCol">
							<div class="co-carType">型号：<span>${partListDesignModel.cartype}</span></div>
							<div class="co-carName">${partListDesignModel.alias}</div>
						</div>
	  				</div>
	  				
	  				<div class="co-headCount" id="showtotalprice">造价总计：￥${partListDesignModel.totalprice/100}</div>
	  				<input type="hidden" value="${partListDesignModel.totalprice/100}" id="totalprice">
		  			
		  			<div class="co-headAction">
		  				<a class="co-headOption" href="javascript:exportPDF(${partListDesignModel.designid});">
			  				<div class="co-headImg"><img src="resources/images/cloudDownload.png"/></div>
			  				<div>下载</div>
		  				</a>
		  				<a class="co-headOption" href="javascript:location.reload();">
			  				<div class="co-headImg"><img src="resources/images/sync.png"/></div>
			  				<div>同步</div>
		  				</a>
		  				<a class="co-headOption" href="javascript:saveEditPart(0);">
			  				<div class="co-headImg"><img src="resources/images/save.png"/></div>
			  				<div>保存</div>
		  				</a>
		  				<a class="co-headOption" href="javascript:saveEditPart(1);">
			  				<div class="co-headImg"><img src="resources/images/save-back.png"/></div>
			  				<div>保存并返回</div>
		  				</a>
		  			</div>
		  		</div>
		  		<div id="container">
		  		<c:forEach var="valueMap" items="${partListDesignModel.valueList}" varStatus="vs">
			  		<div id="list${vs.count}" class="co-content list">
			  			<div class="clearfix">
				  			<div class="pl-contentTitle left ">
				  				<div class="pl-titleTag"></div>
				  				<div class="pl-titleName">${valueMap.partsTypeName}</div>
				  				<div class="pl-titleCount">
				  					<div id="showsum${vs.count}">总价：￥${valueMap.sum/100}</div>
				  					<input type="hidden" id="sum${vs.count}" value="${valueMap.sum/100}">
				  					<input type="hidden" id="projectnum${vs.count}" value="${fn:length(valueMap.list)}">
				  					<div id="showprojectnum${vs.count}">项目：${fn:length(valueMap.list)}</div>
				  				</div>
				  			</div>
				  			
				  			<div class="co-contentAction right">
				  				<a href="javascript:listAdd('${partListDesignModel.designid}','${partListDesignModel.carid}','${valueMap.partsType}');"><i class="fa fa-plus-square-o"></i></a>
				  				<a href="javascript:" class="co-listEdit"><i class="fa fa-edit"></i></a>
				  				<a href="javascript:;" class="co-listDel"><i class="fa fa-trash-o"></i></a>
				  				<a href="javascript:location.reload();" style="display: none"><i class="fa fa-refresh"></i></a>
				  			</div>
			  			</div>
			  			<div class="co-contentList">
				  			<form action="">
				  			     <input type="hidden" value="${vs.count}">
				  				 <table class="table table-bordered table-hover">
							      <thead>
							        <tr>
							          <th>零件号</th>
							          <th>零件名</th>
							          <th>材料</th>
							          <th>数量（件）</th>
							          <th>单价（元/件）</th>
							          <th>供应商</th>
							          <th>备注</th>
							          <th style="width: 5%;"></th>
							        </tr>
							      </thead>
							      <tbody>
							       <c:forEach var="parts" items="${valueMap.list}">
								        <tr class="tr_parts">
								          <td>
								             <input type="text"   class="form-control" id="partsno" disabled value="${parts.partsno}"/>
								             <input type="hidden" class="form-control" id="partsid" value="${parts.id}"/>
								          </td>
								          <td><input type="text" class="form-control"  id="partsname" disabled value="${parts.partsname}"/></td>
								          <td><input type="text" class="form-control"  id="material"  disabled value="${parts.material}"/></td>
								          <td><input type="text" class="form-control"  id="num" disabled value="${parts.num}"/></td>
								          <td><input type="text" class="form-control"  id="price" disabled value="${parts.price/100}"/></td>
								          <td><input type="text" class="form-control"  id="provider" disabled value="${parts.provider}"/></td>
								          <td><input type="text" class="form-control"  id="comment" disabled value="${parts.comment}"/></td>
								          <td><i class="fa fa-circle-o"></i></td>
								        </tr>
	                                 </c:forEach>
							      </tbody>
							    </table>
							    <input class="trSelected" type="hidden" name="" value="0" />
						    </form>
			  			</div>
			  		</div><!-- co-content list1-->
		  		</c:forEach>
              </div><!--container -->
  		</div><!-- client-content -->
  		
  	<!-- Modal -->
	<div class="modal fade" id="partAddModal" tabindex="-1" role="dialog" aria-labelledby="craftModalLabel" data-backdrop="static">
	  <div class="modal-dialog" role="document">
	    <form class="form-horizontal pl-formBox" action="front/carDesign/addPartListDesign" id="partform">
	        <input type="hidden" class="form-control" name="designid" id="designid">
	        <input type="hidden" class="form-control" name="partstype" id="partstype">
	        <input type="hidden" class="form-control" name="carid" id="carid">
	          
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title">增加零件</h4>
		      </div>
		      
		      <div class="modal-body">
				  <div class="form-group">
				    <label class="col-sm-3 control-label">零件号</label>
				    <div class="col-sm-9">
				      <input type="text" class="form-control" name="partsno" id="partsno">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <label class="col-sm-3 control-label">零件名</label>
				    <div class="col-sm-9">
				      <input type="text" class="form-control" name="partsname" id="partsname">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <label class="col-sm-3 control-label">材料</label>
				    <div class="col-sm-9">
				      <input type="text" class="form-control" name="material" id="material">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <label class="col-sm-3 control-label">数量（件）</label>
				    <div class="col-sm-9">
				      <input type="number" class="form-control" name="num" id="num">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <label class="col-sm-3 control-label">单价（元/件）</label>
				    <div   class="col-sm-9">
				        <input type="number" class="form-control" id="deci_price">
				        <input type="hidden" class="form-control" name="price" id="price">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <label class="col-sm-3 control-label">供应商</label>
				    <div class="col-sm-9">
				      <input type="text" class="form-control" name="provider" id="provider">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <label class="col-sm-3 control-label">备注</label>
				    <div class="col-sm-9">
				      <input type="text" class="form-control"  name="comment" id="comment">
				    </div>
				  </div>

		      </div>
		      
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
		        <button type="button" class="btn btn1" onclick="submitAddData()">确定</button>
		      </div>
		    </div>
	     </form>
	  </div>
	</div>
 
  </body>
</html>
